<?php
	include_once("uitilities.php");
	
    session_start();
	$curURL = curPageURL();
	
	//unset($_SESSION['userName']);
	if (!session_is_registered('userName')){
		if($curURL != 'login.php') redirect("login.php?url=".$curURL);
	}
	else if($curURL == 'login.php'){
		if($curURL != 'index.php') redirect("index.php");
	}
	
?>
